-
Notifications
You must be signed in to change notification settings - Fork 980
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add built in runtime deployer #15382
Add built in runtime deployer #15382
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for contributing this, I think it is a good start.
Do you think you could add some basic, simple test? Or do you want me to contribute it? No prob, I can help with that.
conan/internal/deploy.py
Outdated
if not os.path.isdir(libdir_path): | ||
conanfile.output.verbose(f"{libdir_path} does not exist") | ||
continue | ||
file_count = _flatten_directory(dep, conanfile, libdir_path, output_folder, [".dll", ".dylib",".so"]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we just want to do .dylib and .so, but not .dll? because .dll in Windows go to bindirs
, not libdirs
(that is the convention)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes maybe
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'am working on the onnxruntime recipe and I noticed that they create dll in the lib directory.
From what I understand they create some "modules" that are supposed to loaded at runtime, and they are considered as "LIBRARY" and not "RUNTIME" by cmake during the installation: https://cmake.org/cmake/help/book/mastering-cmake/chapter/Install.html#installing-targets
Note that according to their documentation the main dll shall be next the to the modules: https://onnxruntime.ai/docs/build/eps.html#loading-the-shared-providers so for this specific recipe we shall move the dll in the bin dir.
What is the correct solution here?
- Patch the onnxruntime cmake file so that they are copied to the bin folder?
- In the conanfile:package method, after the cmake install move the dll from the lib to the bin folder?
I am asking in this thread because it shows that a normal cmake install with modules create dll in the lib folder so maybe we have to manage this case in the runtime deployer.
I am currently struggling to migrate all our projects to conan 2 and I won't have the time to do work more to this PR so any contribution is more than welcome! |
Started to add some tests and minor code changes |
Hello @memsharded, Do you have time to keep working on this? I think it could come in very handy for many people. Thanks a lot |
Sorry for the delay, things have been a bit busy, and this was stuck in the backlog. I have added some missing things:
Ready to move this for next 2.5 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was thinking that maybe as we have now three built-in deployers, it would be nice to list them in the --help
, something like this?
-d DEPLOYER, --deployer DEPLOYER
Deploy using the provided deployer to the output folder.
Built-in deployers: 'full_deploy', 'direct_deploy', 'runtime_deploy'
Done, added docstrings. |
I'm kind of surprised this was included in the 2.5.0 release with the two major bugs still present ( |
Changelog: Feature: Add built in
runtime_deploy
deployer.Docs: conan-io/docs#3789
Fix #15381
This PR is currently a draft, only tested manually on windows with:
Remaining tasks that I won't have the time to complete:
And a weird behavior I observed: dep.cpp_info.bindirs and dep.cpp_info.libdirs are populated with absolute paths instead of relative path like described in the documentation.
Docs: https://github.com/conan-io/docs/pull/XXXX
develop
branch, documenting this one.